package vn.fpt.fsoft.entities;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Author DuongPV1
 * Entity TrustDistrict mapping with TrusDistrict table 
 * */
@Entity
@Table(name="TrustDistrict")
public class TrustDistrict implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int trustDistrictId;
	private TrustRegion trustRegion;
	private String name;
	private String description;
	public TrustDistrict() {
		// TODO Auto-generated constructor stub
	}
	
	/**
	 * @param trustDistrictId
	 * @param trustRegion
	 * @param name
	 * @param description
	 */
	public TrustDistrict(int trustDistrictId, TrustRegion trustRegion,
			String name, String description) {
		super();
		this.trustDistrictId = trustDistrictId;
		this.trustRegion = trustRegion;
		this.name = name;
		this.description = description;
	}
	@Id
	@GeneratedValue
	@Column(name="TrustDistrictId",nullable=false,unique=true)
	public int getTrustDistrictId() {
		return trustDistrictId;
	}
	public void setTrustDistrictId(int trustDistrictId) {
		this.trustDistrictId = trustDistrictId;
	}
	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="TrustregionId",nullable=false)
	public TrustRegion getTrustRegion() {
		return trustRegion;
	}
	public void setTrustRegion(TrustRegion trustRegion) {
		this.trustRegion = trustRegion;
	}
	@Column(name="Name",nullable=true,length=50)
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	@Column(name="Description",nullable=true)
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	

}
